<script setup>
import * as Icons from '@/config/icons'

const emit = defineEmits(['add', 'remove-batch', 'search', 'sort'])
</script>

<template>
  <div class="actions">
    <el-button-group>
      <el-button type="primary" :icon="Icons['Plus']" @click="emit('add')"> 新增 </el-button>
      <el-button type="danger" :icon="Icons['Delete']" plain @click="emit('remove-batch')">
        批量删除
      </el-button>
    </el-button-group>

    <el-button-group>
      <el-button :icon="Icons['Search']" link @click="emit('search')"></el-button>
      <el-button :icon="Icons['Histogram']" link @click="emit('sort')"></el-button>
    </el-button-group>
  </div>
</template>

<style lang="scss" scoped>
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
